package cn.com.css.taxInspection.workflow.controller;

import io.swagger.annotations.Api;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import cn.com.css.taxInspection.system.entity.SysLog;
import cn.com.css.taxInspection.system.mapper.SysLogMapper;
import cn.com.css.taxInspection.system.service.impl.HttpSessionService;

import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestParam;


@Api(tags = "服务端口视图")
@Controller
@RequestMapping("/index/workflow")
public class IndexWorkflowController {

    @Resource
    private HttpSessionService httpSessionService;

    @Resource
    private SysLogMapper sysLogMapper;

    /*检查人环节*/
    @GetMapping("/inspectPage11")
    public String inspectPage11() {
        return "inspect/list11";
    }

    /*检查科科长环节*/
    @GetMapping("/inspectPage12")
    public String inspectPage12() {
        return "inspect/list12";
    }

    /*检查科主管局长环节*/
    @GetMapping("/inspectPage13")
    public String inspectPage13() {
        return "inspect/list13";
    }

    /*审理员环节*/
    @GetMapping("/hearPage21")
    public String hearPage21() {
        return "hear/list21";
    }

    /*执行员环节*/
    @GetMapping("/zxyhj")
    public String zxyhj() {
        return "zxhj/zxyhj" ;
    }

    /*副审环节*/
    @GetMapping("/hearPage22")
    public String hearPage22() {
        return "hear/list22";
    }

    /*科长环节*/
    @GetMapping("/hearPage23")
    public String hearPage23() {
        return "hear/list23";
    }

    /*主管局长环节*/
    @GetMapping("/hearPage24")
    public String hearPage24() {
        return "hear/list24";
    }

    /*会议审环节*/
    @GetMapping("/meetPage")
    public String meetPage() {
        return "meet/list";
    }

    /*案源环节-案源情况说明*/
    @GetMapping("/casesourcePage")
    public String casesourcePage(@RequestParam(required = false) String aybz, Model model) {
        // 如果未传 aybz，默认设为 "ay"
        model.addAttribute("aybz", aybz != null ? aybz : "ay");
        return "casesource/list";
    }

    /*检查环节-案源情况说明*/
    @GetMapping("/jcayqksm")
    public String jcayqksm(@RequestParam(required = false) String aybz, Model model) {
        // 如果未传 aybz，默认设为 "jc"
        model.addAttribute("aybz", aybz != null ? aybz : "jc");
        return "casesource/list";
    }

    /*审理环节-案源情况说明*/
    @GetMapping("/slayqksm")
    public String slayqksm(@RequestParam(required = false) String aybz, Model model) {
        // 如果未传 aybz，默认设为 "sl"
        model.addAttribute("aybz", aybz != null ? aybz : "sl");
        return "casesource/list";
    }


    /*案源信息查询*/
    @GetMapping("/ayxxcx")
    public String ayxxcx() {
        return "casesource/ayxxcx";
    }

    /*执行情况说明*/
    @GetMapping("/carryoutPage")
    public String carryoutPage() {
        return "carryout/list";
    }

    /*执行情况查询*/
    @GetMapping("/zxqkcx")
    public String zxqkcx() {
        return "carryout/zxqkcx";
    }

    /*执行台账*/
    @GetMapping("/zxtz")
    public String zxtz() {
        return "carryout/zxtz";
    }

    /*欠税台账*/
    @GetMapping("/qstz")
    public String qstz() {
        return "carryout/qstz";
    }

    /*日志*/
    @GetMapping("/logPage")
    public String logPage() {
        return "logmanagement/list";
    }

    /*日志确认*/
    @GetMapping("/logConfirmPage")
    public String logConfirmPage() {
        return "logmanagement/logconfirm";
    }

    /*科长审批*/
    @GetMapping("/logsectionchiefPage")
    public String logsectionchiefPage() {
        return "logmanagement/listsectionchief";
    }

    /*科长审批*/
    @GetMapping("/gzdd")
    public String gzdd() {
        return "logmanagement/gzdd";
    }

    /*实现系统生成《稽查部门税务处理处罚决定数据汇总表及工作底稿（月度）》报表*/
    @GetMapping("/cfjdbb")
    public String cfjdbb() {
        return "logmanagement/cfjdbb";
    }

    /*实现系统生成《稽查部门税务处理处罚决定数据汇总表及工作底稿（月度）》报表*/
    @GetMapping("/cfqkcx")
    public String cfqkcx() {
        return "logmanagement/cfqkcx";
    }

    /*纪检审批*/
    @GetMapping("/logdisciplinePage")
    public String logdisciplinePage() {
        return "logmanagement/listdiscipline";
    }

    /*调整检查科室*/
    @GetMapping("/debugtaxorgPage")
    public String debugtaxorgPage() {
        return "debugtax/list1";
    }

    /*调整审理人员*/
    @GetMapping("/debugtaxmanPage")
    public String debugtaxmanPage() {
        return "debugtax/list2";
    }

    /*2024-1-3-最新调整案件页面*/
    @GetMapping("/debugtaxJgRyPage")
    public String debugtaxJgRyPage() {
        return "debugtax/list3";
    }

    @GetMapping("/debugtaxLajcPage")
    public String debugtaxLajcPage() {
        return "debugtax/list4";
    }

    @GetMapping("/debugtaxZcjcPage")
    public String debugtaxZcjcPage() {
        return "debugtax/list5";
    }

    @GetMapping("/debugtaxZxRyPage")
    public String debugtaxZxRyPage() {
        return "debugtax/list6";
    }

    @GetMapping("/bcajglPage")
    public String bcajglPage() {
        return "debugtax/list7";
    }

    /*阈值设置*/
    @GetMapping("/threshold")
    public String sysDict() {
        return "threshold/list";
    }

    /*两书对比提醒(审理员)*/
    @GetMapping("/riskPage11")
    public String riskPage11() {
        return "risk1/list1";
    }

    /*两书对比提醒(科长)*/
    @GetMapping("/riskPage12")
    public String riskPage12() {
        return "risk1/list2";
    }

    /*两书对比提醒(局长)*/
    @GetMapping("/riskPage13")
    public String riskPage13() {
        return "risk1/list3";
    }

    /*打招呼台账录入*/
    @GetMapping("/greetwritePage")
    public String greetwritePage() {
        return "greet/list";
    }

    /*打招呼台账查询*/
    @GetMapping("/greetqueryPage")
    public String greetqueryPage() {
        return "greet/list1";
    }

    /*日志查询(科长)*/
    @GetMapping("/logqueryPage")
    public String logqueryPage() {
        return "logmanagement/querylist";
    }

    /*日志查询(局长)*/
    @GetMapping("/logqueryPage1")
    public String logqueryPage1() {
        return "logmanagement/querylist1";
    }

    /*日志查询2*/
    @GetMapping("/logqueryPage2")
    public String logqueryPage2() {
        return "logmanagement/querylist2";
    }

    /*日志统计(局长)*/
    @GetMapping("/logStatisticsPage")
    public String logStatisticsPage() {
        return "logmanagement/statisticslist";
    }

    /*日志统计(全市)*/
    @GetMapping("/logStatisticsSjPage")
    public String logStatisticsSjPage() {
        return "logmanagement/statisticsSjlist";
    }

    /*日志统计(局长)*/
    @GetMapping("/bookPage")
    public String bookPage() {
        return "book/list";
    }

    /*案件回访*/
    @GetMapping("/visitPage")
    public String visitPage() {
        return "visit/list";
    }

    /*案件回访*/
    @GetMapping("/hftjqj")
    public String hftjqj() {
        return "visit/hftjqj";
    }

    /*廉政告知书*/
    @GetMapping("/notificationPage")
    public String notificationPage() {
        return "notification/list";
    }

    /*廉政告知书-全局*/
    @GetMapping("/notificationPage1")
    public String notificationPage1() {
        return "notification/list1";
    }

    /*廉政告知书-全市*/
    @GetMapping("/notificationPage2")
    public String notificationPage2() {
        return "notification/list2";
    }


    /*廉政告知书统计-全局*/
    @GetMapping("/notificationPage3")
    public String notificationPage3() {
        return "notification/list3";
    }

    /*廉政告知书统计-全市*/
    @GetMapping("/notificationPage4")
    public String notificationPage4() {
        return "notification/list4";
    }

    /*案件信息维护*/
    @GetMapping("/compensate")
    public String compensate() {
        return "compensate/ajxxwh";
    }

    /*收入补偿*/
    @GetMapping("/srbc")
    public String srbc() {
        return "compensate/srbc";
    }

    /*日志模板配置*/
    @GetMapping("/logtemplate")
    public String logtemplate() {
        return "survey/create";
    }

    /*案件统计(检查)*/
    @GetMapping("/inspectStatistics")
    public String inspectStatistics() {
        return "inspect/statistics";
    }

    /*案件统计(审理)*/
    @GetMapping("/hearStatistics")
    public String hearStatistics() {
        return "hear/statistics";
    }

    /*工作调度-案件调度模板*/
    @GetMapping("/gzddAjddmb")
    public String gzddAjddmb() {
        return "gzdd/ajddmb";
    }

    /*工作调度-案件调度（全局）*/
    @GetMapping("/gzddAjddqj")
    public String gzddAjddqj() {
        return "gzdd/ajddqj";
    }

    /*工作调度-案件调度（全市）*/
    @GetMapping("/gzddAjddqs")
    public String gzddAjddqs() {
        return "gzdd/ajddqs";
    }

    public void saveSysLog(SysLog sysLog) {
        sysLog.setUsername(httpSessionService.getCurrentUsername());
        sysLog.setUserId(httpSessionService.getCurrentUsername());
        sysLogMapper.insert(sysLog);
    }
}
